package com.example.broad.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * @author: snjgm
 * data: 2022/7/22
 * description: 标准广播
 */
public class StandardReceiver extends BroadcastReceiver {
    public static final String STANDARD_ACTION = "broad";

    //一旦收到标准广播,就会马上触发接收器的reciver方法
    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent != null && intent.getAction().equals(STANDARD_ACTION)){
            Log.d("NING","收到一个标准广播");
        }
    }
}
